/**
 * 
 */
package com.sl.init;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author lunshi
 *
 */
@Component
@Order(4)  //存在多个Runner的时候执行顺序
public class ApplicationRunner2 implements ApplicationRunner {
	private static final Logger logger = LoggerFactory.getLogger(ApplicationRunner2.class);

	@Override
	public void run(ApplicationArguments args) throws Exception {
		logger.info(this.getClass().getSimpleName()+"run执行,order="+this.getClass().getAnnotation(Order.class).value());
		Thread.sleep(2000);
	}

}
